<?php
/**
 * @copyright 2025 银杏WMS
 * @author 银杏WMS
 * @version 1.0
 * @license http://www.hhyx.xyz
 * @developer Lhf
 */

namespace app\admin\model\yxerp;

use think\Model;

class WarehouseOperationDetail extends Model
{
    // 表名
    protected $name = 'yxerp_warehouse_operation_detail';
    
    // 自动写入时间戳
    protected $autoWriteTimestamp = true;
    
    /**
     * 关联主单据
     */
    public function operation()
    {
        return $this->belongsTo('WarehouseOperation', 'operation_id');
    }
    
    /**
     * 关联产品
     */
    public function product()
    {
        return $this->belongsTo('Product', 'product_id');
    }
    
    /**
     * 关联单位
     */
    public function unit()
    {
        return $this->belongsTo('Unit', 'unit_id');
    }
    
    /**
     * 关联货位
     */
    public function location()
    {
        return $this->belongsTo('WarehouseLocation', 'location_id');
    }
} 